// 容器样式 - 深色主题
.container {
  min-height: 100vh;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
  
  // 覆盖全局深色主题
  :global(.ant-typography) {
    color: #ffffff !important;
  }
  
  :global(.ant-card) {
    background: #1a1a1a !important;
    color: #ffffff !important;
    border-color: #333 !important;
  }
  
  :global(.ant-card-head) {
    color: #ffffff !important;
    border-bottom-color: #333 !important;
  }
  
  :global(.ant-card-head-title) {
    color: #ffffff !important;
  }
  
  :global(.ant-btn) {
    &.ant-btn-default {
      background-color: #2a2a2a !important;
      border-color: #444 !important;
      color: #e0e0e0 !important;
      
      &:hover {
        background-color: #333 !important;
        border-color: #555 !important;
      }
    }
    
    &.ant-btn-primary {
      background-color: #00ff00 !important;
      border-color: #00ff00 !important;
      color: #000000 !important;
      
      &:hover {
        background-color: #00cc00 !important;
        border-color: #00cc00 !important;
      }
    }
    
    // 头部按钮样式优化 - 参照停止服务按钮样式
    &.ant-btn-text {
     background-color: #2a2a2a !important;
      border-color: #444 !important;
      color: #e0e0e0 !important;
      
      &:hover {
        background-color: #2a2a2a !important;
      border-color: #444 !important;
      color: #e0e0e0 !important;
      }
      
      &:focus {
        background-color: #ff7875 !important;
        border-color: #ff7875 !important;
        color: #ffffff !important;
      }
      
      &:active {
        background-color: #d9363e !important;
        border-color: #d9363e !important;
        color: #ffffff !important;
      }
    }
  }
  
  :global(.ant-tag) {
    background: transparent !important;
    border: none !important;
    color: #e0e0e0 !important;
    
    &:hover {
      background: transparent !important;
      color: #ffffff !important;
    }
  }
}

// 顶部导航栏 - 深色主题
.header {
  background: rgba(26, 26, 26, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #333;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);

  .headerContent {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;

    @media (min-width: 640px) {
      padding: 0 24px;
    }

    @media (min-width: 1024px) {
      padding: 0 32px;
    }
  }

  .headerLeft {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .logo {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    
    img {
      border-radius: 6px;
      object-fit: cover;
    }
  }

  .title {
    margin: 0 !important;
    color: #ffffff;
    font-size: 20px;
    font-weight: 600;
  }

  .headerRight {
    display: flex;
    align-items: center;
    
    // 头部按钮样式优化 - 参照停止服务按钮样式
    :global(.ant-btn-text) {
      background-color: #ff4d4f !important;
      border-color: #ff4d4f !important;
      color: #ffffff !important;
      border-radius: 6px !important;
      
      &:hover {
        background-color: #ff7875 !important;
        border-color: #ff7875 !important;
        color: #ffffff !important;
        transform: translateY(-1px);
      }
      
      &:focus {
        background-color: #ff7875 !important;
        border-color: #ff7875 !important;
        color: #ffffff !important;
      }
      
      &:active {
        background-color: #d9363e !important;
        border-color: #d9363e !important;
        color: #ffffff !important;
      }
    }
    
    // Badge 样式优化 - 参照停止服务按钮样式
    :global(.ant-badge) {
      background-color: #ff4d4f !important;
      border: 1px solid #ff4d4f !important;
      border-radius: 6px !important;
      padding: 4px 8px !important;
      
      .ant-badge-status-text {
        color: #ffffff !important;
        font-weight: 500 !important;
      }
      
      .ant-badge-status-dot {
        display: none !important;
      }
      
      &:hover {
        background-color: #ff7875 !important;
        border-color: #ff7875 !important;
        transform: translateY(-1px);
      }
      
      &:active {
        background-color: #d9363e !important;
        border-color: #d9363e !important;
      }
    }
  }
}

// 主内容区域
.content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 16px;

  @media (min-width: 640px) {
    padding: 32px 24px;
  }

  @media (min-width: 1024px) {
    padding: 32px;
  }
}

// 控制面板 - 深色主题
.controlPanel {
  margin-bottom: 32px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  border: 1px solid #333;
  background: #1a1a1a;

  :global(.ant-card-head) {
    border-bottom: 1px solid #333;
    padding: 0 24px;
    background: #1a1a1a;
  }

  :global(.ant-card-body) {
    padding: 24px;
    background: #1a1a1a;
  }
}

// 按钮样式 - 基于图片配色
.startButton {
  background: linear-gradient(135deg, #00ff00 0%, #00cc00 100%);
  border: none;
  color: #000000;
  box-shadow: 0 2px 4px rgba(0, 255, 0, 0.3);

  &:hover {
    background: linear-gradient(135deg, #00cc00 0%, #009900 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 255, 0, 0.4);
    color: #000000;
  }

  &:disabled {
    background: #444;
    transform: none;
    box-shadow: none;
    color: #666;
  }
}

.forceStopButton {
  background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
  border: none;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(255, 68, 68, 0.3);

  &:hover {
    background: linear-gradient(135deg, #cc0000 0%, #990000 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 68, 68, 0.4);
    color: #ffffff;
  }

  &:disabled {
    background: #444;
    transform: none;
    box-shadow: none;
    color: #666;
  }
}

// 状态信息区域
.statusSection {
  margin-bottom: 32px;
}

.statusCard {
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  border: 1px solid #333;
  height: 100%;
  background: #1a1a1a;

  :global(.ant-card-head) {
    border-bottom: 1px solid #333;
    padding: 0 24px;
    background: #1a1a1a;
  }

  :global(.ant-card-body) {
    padding: 24px;
    background: #1a1a1a;
  }
}

.statusItem {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #333;

  &:last-child {
    border-bottom: none;
  }
}

.truncateText {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}

// 日志卡片 - 深色主题
.logCard {
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  border: 1px solid #333;
  background: #1a1a1a;

  :global(.ant-card-head) {
    border-bottom: 1px solid #333;
    padding: 0 24px;
    background: #1a1a1a;
  }

  :global(.ant-card-body) {
    padding: 24px;
    background: #1a1a1a;
  }
}

.logContainer {
  background: #0a0a0a;
  border-radius: 8px;
  padding: 16px;
  height: 320px;
  overflow-y: auto;
  border: 1px solid #333;
}

.emptyLogs {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #666;
  gap: 8px;

  :global(.anticon) {
    font-size: 48px;
    color: #444;
  }
}

.logList {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 14px;
  line-height: 1.5;
}

.logItem {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #333;

  &:last-child {
    border-bottom: none;
  }
}

.logTime {
  color: #666;
  font-size: 12px;
  flex-shrink: 0;
  min-width: 80px;
}

.logContent {
  color: #e0e0e0;
  word-break: break-all;
  flex: 1;
}

// 加载遮罩 - 深色主题
.loadingOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loadingCard {
  border-radius: 12px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  background: #1a1a1a;
  border: 1px solid #333;
  min-width: 200px;
}

.loadingText {
  font-weight: 500;
  color: #ffffff;
}

// 响应式设计
@media (max-width: 768px) {
  .header {
    .headerContent {
      height: 56px;
    }

    .title {
      font-size: 18px;
    }
  }

  .content {
    padding: 16px;
  }

  .controlPanel,
  .statusCard,
  .logCard {
    :global(.ant-card-head) {
      padding: 0 16px;
    }

    :global(.ant-card-body) {
      padding: 16px;
    }
  }

  .logContainer {
    height: 240px;
  }
}

// 滚动条样式 - 深色主题
.logContainer::-webkit-scrollbar {
  width: 6px;
}

.logContainer::-webkit-scrollbar-track {
  background: #1a1a1a;
  border-radius: 3px;
}

.logContainer::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 3px;

  &:hover {
    background: #555;
  }
}

// 动画效果
.controlPanel,
.statusCard,
.logCard {
  transition: all 0.2s ease-in-out;

  &:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
  }
}

// 标签样式增强 - 深色主题
.container :global(.ant-tag) {
  border-radius: 6px;
  font-weight: 500;
  
  &.ant-tag-success {
    color: #00ff00 !important;
  }
  
  &.ant-tag-error {
    color: #ff4444 !important;
  }
  
  &.ant-tag-warning {
    color: #ffaa00 !important;
  }
}

// 按钮组样式
.container :global(.ant-space) {
  gap: 12px !important;
}

// 卡片标题样式
.container :global(.ant-card-head-title) {
  font-weight: 600;
  color: #ffffff;
}

// 状态指示器样式
.container :global(.ant-badge-status-dot) {
  &.ant-badge-status-success {
    background-color: #00ff00 !important;
  }
  
  &.ant-badge-status-error {
    background-color: #ff4444 !important;
  }
  
  &.ant-badge-status-warning {
    background-color: #ffaa00 !important;
  }
}

// 统计数值样式
.container :global(.ant-statistic) {
  .ant-statistic-title {
    color: #cccccc !important;
  }
  
  .ant-statistic-content {
    color: #ffffff !important;
  }
}
